package cultivameCore.motor.threads;

import cultivameCore.entorno.Entorno;
import cultivameCore.planta.Planta;

public class MonitorThread extends Thread{
	
	private Planta p;
	private Entorno e;
	private int ms=500;
	private boolean b=true;
	
	public MonitorThread(Planta pl,Entorno ent){
		p=pl;
		e=ent;
	}
	
	public void run(){
		while(b){
			limpiarPantalla();
			System.out.println(p);
			System.out.println(e);
			try {
				sleep(ms);
			} catch (InterruptedException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			
		}
	}

	public Planta getPlanta() {
		return p;
	}

	public void setPlanta(Planta p) {
		this.p = p;
	}

	public Entorno getEntorno() {
		return e;
	}

	public void setEntorno(Entorno e) {
		this.e = e;
	}

	private void limpiarPantalla() {
		// TODO Auto-generated method stub
		for(int i =0;i<25;i++){
			System.out.println();
		}
	}
	
	public void clear(){
		b=false;
	}

}
